// Devin Koepl

#include <stdlib.h>
#include <gtkmm.h>
#include <stdlib.h>
#include <cairomm/context.h>

#include <ros/ros.h>

#include <fca/ucontroller.h>

#include <fca_controllers/controller.h>
#include <fca_controllers/fca_srv.h>

#include <drl_library/drl_math.h>

// GUI objects
Gtk::Window *window;

Gtk::Notebook *controller_notebook;

Gtk::HScale *motor_torque_hscale;

Gtk::HScale *motor_position_hscale;
Gtk::HScale *p_motor_position_hscale;
Gtk::HScale *d_motor_position_hscale;


Gtk::DrawingArea *drawing_area;

Gtk::ProgressBar *motor_torque_progress_bar;

Gtk::CheckButton *log_file_chkbox;
Gtk::FileChooser *log_file_chooser;

Gtk::Button * restart_button;
Gtk::Button * enable_button;
Gtk::Button * disable_button;

Cairo::RefPtr<Cairo::Context> cr;
Gtk::Allocation drawing_allocation;

//FILE *logFile;

ros::ServiceClient fca_client;
fca_controllers::fca_srv fca_srv;

FILE *log_file_fp;

bool poke_controller( void );

void log_chkbox_toggled( void );

void restart_robot( void );
void enable_motors( void );
void disable_motors( void );
void log_start( void );

void switch_controllers(GtkNotebookPage *, guint);

void draw_leg();
